package net.easyjava.framework.third.aws.s3;

import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.model.PutObjectResult;
import net.easyjava.framework.third.aws.AWSUtils;

import java.io.File;

/**
 * Created by wxnacy on 16/11/25.
 */
public class AWSS3Utils extends AWSUtils {
    private AmazonS3Client s3Client;

    public AWSS3Utils(String accessKey, String secretKey) {
        super(accessKey, secretKey);
        this.init();
    }

    @Override
    public void init() {
        super.init();
        s3Client = new AmazonS3Client(this.credentials);
    }


    public PutObjectResult putObject(String bucketName, String key, File file){
        PutObjectResult result = s3Client.putObject(bucketName, key, file);
        return result;
    }

}
